package java1;
import java.util.Scanner;

public class T3 {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		while(sc.hasNextDouble()){
        double num=sc.nextDouble();
         num=Math.abs(num);
         for (; num%(int)num>0;) {
			num=num*10;
         }
         int a=(int)num;
		 String str=Integer.toString(a);
         int c=0;
         for (int i = 0; i < str.length(); i++) {
				c=c+Integer.parseInt(str.substring(i,i+1));
			}
         System.out.println(c);
		}
	}

}
